<?php
/**
 * Prepares usertype,block,sendEmail,registerDate,lastvisitDate,activation,
 * forgotten_password_code attributes before performing validation
 */
abstract class UsersActiveRecord extends CActiveRecord {
    protected function beforeValidate(){
        if ($this->isNewRecord) {
            $this->usertype = 'member';
            $this->block    = 20;
            $this->sendEmail = 30;
            $this->registerDate = new CDbExpression('NOW()');
            $this->lastvisitDate = $this->registerDate;
            $this->activation = 'activation';
            $this->forgotten_password_code = 'bodd.biz';
        }
        return parent::beforeValidate();
    }
}

?>
